
//
//  Footer.m
//  PTravel
//
//  Created by dllo on 15/11/20.
//  Copyright © 2015年 李涵. All rights reserved.
//

#import "Footer.h"

@implementation Footer

- (void)dealloc
{
    [_sortButton release];
    [super dealloc];
}

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changColor) name:@"night" object:nil];
        [self createSubViews];
    }
    return self;
}

- (void)changColor
{
    self.backgroundColor = CELLCOLOR;
    [self.sortButton setTitleColor:TEXTCOLOR forState:UIControlStateNormal];
    self.sortButton.backgroundColor = CELLCOLOR;
}

- (void)createSubViews
{
        self.sortButton.backgroundColor = CELLCOLOR;
    self.sortButton = [UIButton buttonWithType:UIButtonTypeCustom];
    self.sortButton.frame = CGRectMake(0, 0, BOUNDS.size.width, 49);
    [self.sortButton setTitle:@"排序" forState:UIControlStateNormal];
    [self.sortButton setTitleColor:TEXTCOLOR forState:UIControlStateNormal];
    [self.sortButton setBackgroundColor:[UIColor orangeColor]];
    [self addSubview:self.sortButton];
    [_sortButton release];
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
